using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class GameManager : MonoBehaviour
{
    public Naicy _naicy;
    public GameObject canvasPanel;
    public TextMeshProUGUI textName;
    public TextMeshProUGUI textContent;

    public GameObject battleSence;
    
    private int index = 0;
    
    public bool ShowDialog()
    {
        if (index >= _naicy.DialogList.Count)
        {
            index = 0;
            canvasPanel.SetActive(false);
            return true;
        }

        canvasPanel.SetActive(true);
        textName.text = _naicy.DialogList[index].Role == 0 ? "naicy：" : "luna：";
        textContent.text = _naicy.DialogList[index].Talk;
        index++;
        return false;
    }


    public void enterBattle()
    {
        battleSence.SetActive(true);
        
        
    }
    
    
    
    
}

public class DialogObject
{
    private int role; // 角色
    private string talk; // 对话

    public DialogObject(int role, string talk)
    {
        this.role = role;
        this.talk = talk;
    }

    public int Role => role;

    public string Talk => talk;
}